package edu.hawaii.myisern.action;

import java.util.List;
import edu.hawaii.myisern.model.Log;
import edu.hawaii.myisern.model.Model;
import edu.hawaii.myisern.model.MyCollaboration;
import edu.hawaii.myisern.model.MyOrganization;
import edu.hawaii.myisern.model.MyResearcher;

/**
 * Provides a data integrity report.
 * 
 * This isn't actually an action bean, just a bean. TODO make it an action bean?
 * 
 * @author Brian Jaress
 * @author Randy Cox
 */
public class ReportActionBean {

  /**
   * Build a report of dangling references, missing fields, etc.
   * 
   * @return a report
   */
  public List<List<String>> getResearcherCheck() {
    return Model.getInstance().researcherCheck();
  }

  /**
   * Build a report of dangling references, missing fields, etc.
   * 
   * @return a report
   */
  public List<List<String>> getOrganizationCheck() {
    return Model.getInstance().organizationCheck();
  }

  /**
   * Build a report of dangling references, missing fields, etc.
   * 
   * @return a report
   */
  public List<List<String>> getCollaborationCheck() {
    return Model.getInstance().collaborationCheck();
  }

  /**
   * Build a table list of the researchers.
   * 
   * @return a report
   */
  public List<MyResearcher> getResearcherTable() {
    List<MyResearcher> list = Model.getInstance().listResearchers();
    Integer count = list.size();
    Log.enter("ReportActionBean getResearcherTable() count = " + count.toString());
    return list;
  }

  /**
   * Build a table list of the organizations.
   * 
   * @return a report
   */
  public List<MyOrganization> getOrganizationTable() {
    List<MyOrganization> list = Model.getInstance().listOrganizations();
    Integer count = list.size();
    Log.enter("ReportActionBean getOrganizaitonTable() count = " + count.toString());
    return list;
  }

  /**
   * Build a table list of the collaborations.
   * 
   * @return a report
   */
  public List<MyCollaboration> getCollaborationTable() {
    return Model.getInstance().listCollaborations();
  }

}
